import request from "@/utils/request";

/**
 * @description 列表
 * @param data
 * @returns
 */
export const getStoreListApi: IGetStoreListApi = function (params) {
  return request.get("htscrm/store/list", { params });
};

/**
 * @description 所有数据
 * @param params
 * @returns
 */
export const getStoreAllApi: IGetStoreAllApi = function (params) {
  return request.get(`htscrm/store/all`, { params });
};

/**
 * @description 详情
 * @param data
 * @returns
 */
export const getStoreDetailApi: IGetStoreDetailApi = function (id) {
  return request.get(`htscrm/store/info/${id}`);
};

/**
 * @description 添加
 * @param data
 * @returns
 */
export const addStoreApi: IAddStoreApi = function (data) {
  return request.post("htscrm/store/add", data);
};

/**
 * @description 编辑
 * @param data
 * @returns
 */
export const updateStoreApi: IUpdateStoreApi = function (data) {
  return request.post(`htscrm/store/edit/${data.id}`, data);
};

/**
 * @description 删除
 * @param data
 * @returns
 */
export const deleteStoreApi: IDeleteStoreApi = function (id) {
  return request.post(`htscrm/store/del/${id}`);
};

/**
 * @description 批量通过
 * @param data
 * @returns
 */
export const postBatchPass: any = function (ids: any) {
  return request.post(`htscrm/users/tongguoall`, ids);
};

/**
 * @description 批量拒绝
 * @param data
 * @returns
 */
export const postBatchRefuse: any = function (ids: any) {
  return request.post(`htscrm/users/jujueall`, ids);
};

/**
 * @description 批量删除
 * @param data
 * @returns
 */
export const batchDeleteStoreApi: IBatchDeleteStoreApi = function (ids) {
  return request.post(`htscrm/store/delete`, { ids });
};

/**
 * @description 获取转移门店信息
 * @param data
 * @returns
 */
export const getChangeStoreInfoApi: IGetChangeStoreInfoApi = function (id) {
  return request.get(`htscrm/store/change_info/${id}`);
};

/**
 * @description 转移资产
 * @param data
 * @returns
 */
export const transferMoneyApi: ITransferMoneyApi = function (data) {
  return request.post(`htscrm/store/transfer_money/${data.store_id}`, data);
};

/**
 * @description 转移用户
 * @param data
 * @returns
 */
export const transferUserApi: ITransferUserApi = function (data) {
  return request.post(`htscrm/store/transfer_user/${data.store_id}`, data);
};

/**
 * @description 充值
 * @param data
 * @returns
 */
export const rechargeApi: IRechargeApi = function (data) {
  return request.post(`htscrm/store/recharge/${data.store_id}`, data);
};

/**
 * @description 资金明细
 * @param data
 * @returns
 */
export const getStoreMoneyLogApi: IGetStoreMoneyLogApi = function (data) {
  return request.post(`htscrm/store/money_log/${data.store_id}`, data);
};

/**
 * @description 修改密码
 * @param data
 * @returns
 */
export const updatePasswordApi: IUpdatePasswordApi = function (data) {
  return request.post(`htscrm/store/update_password/${data.store_id}`, data);
};

/**
 * @description 获取CDN数据
 * @param data
 * @returns
 */
export const getCdnDataApi: IGetStoreMoneyLogApi = function () {
  return request.get(`htscrm/cdn/getCdnData`, {});
};

/**
 * @description table
 * @param data
 * @returns
 */
export const getCdnUseLogApi: IGetStoreMoneyLogApi = function (data) {
  return request.post(`htscrm/cdn/getCdnUseLog`, data);
};

/**
 * @description 充值
 * @param data
 * @returns
 */
export const addCdnDataApi: IGetStoreMoneyLogApi = function (data) {
  return request.post(`htscrm/cdn/addCdn`, data);
};
